package com.kingschan.jeasytag.tag.form;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import com.kingschan.jeasytag.core.annotations.tag.*;
import com.kingschan.jeasytag.core.parse.TagParseFactory;
import com.kingschan.jeasytag.tag.RootTag;
/**
 * ����ؼ�
 * @author kingschan
 *date:2013-3-19
 */

@TagMetaData(CssClass = "easyui-calendar", tag = "div"
)
public class CalendarTag extends RootTag {
	private static final long serialVersionUID = 1L;
	@BooleanField
	private boolean fit;
	@BooleanField
	private boolean border;
	@StringField
	private String id;
	@NumberField
	private String height;
	@NumberField
	private String width;
	@EventField(args = "date", description = "")
	private String onSelect;
	@EventField(args = "date", description = "")
	private String moveTo;


	@Override
	public int doStartTag() throws JspException {		
		try {
			this.pageContext.getOut().write(TagParseFactory.executeParse(this,pageContext));
			
		} catch (Exception e) {		
			e.printStackTrace();
		}
		return super.doStartTag();
	}
	
	@Override
	public int doEndTag() throws JspException {
		try {
			this.pageContext.getOut().write("</div>");
		} catch (IOException e) {
			e.printStackTrace();
		}
		return super.doEndTag();
	}
	
	public boolean isFit() {
		return fit;
	}

	public void setFit(boolean fit) {
		this.fit = fit;
	}

	public boolean isBorder() {
		return border;
	}

	public void setBorder(boolean border) {
		this.border = border;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public String getOnSelect() {
		return onSelect;
	}

	public void setOnSelect(String onSelect) {
		this.onSelect = onSelect;
	}

	public String getMoveTo() {
		return moveTo;
	}

	public void setMoveTo(String moveTo) {
		this.moveTo = moveTo;
	}

}
